﻿@using Newtouch.Infrastructure;
@{
    ViewBag.Title = "常用诊断列表";
    Layout = "~/Views/Shared/_Form.cshtml";
}

<div class="gridPanel">
    <table id="gridList"></table>
    @*<div id="gridPager"></div>*@
</div>

<script>
    $(function () {
        var type = $.request("type");
        var mzh = $.request("mzh");
        pageInit(type, mzh);
    });
    function pageInit(type, mzh) {
        $("#gridList").dataGrid(
            {
                url: "/MedicalRecord/GetDiagsLists?type=" + type + "&mzh=" + mzh,
                colModel: [
                    { label: '诊断名称', name: 'zdmc', width: 100, align: 'left' },
                    { label: '诊断编码', name: 'zdCode', width: 150, align: 'left' },
                    { label: '拼音', name: 'py', width: 150, align: 'left', hidden: true },
                    { label: 'icd10', name: 'icd10', width: 120, align: 'left' },
                ],
                viewrecords: false,
                width: "100%",
                autowidth: true,
                height: $(window).height() - 55,
                ondblClickRow: function (row) {

                    var rowData = $('#gridList').jqGrid('getRowData', row);
                    AcceptClick(rowData);
                },
            });
    }
    
    function AcceptClick(callBack) {

        var rowData = $('#gridList').jqGrid('getGridParam', 'selrow');
        var rowData2 = $('#gridList').jqGrid('getRowData', rowData);
        callBack(rowData2);
        $.modalClose();
    }
</script>